package com.gongpingjialoan.activity.sell;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.gongpingjialoan.R;
import com.gongpingjialoan.activity.car.SellCarHistoryActivity;
import com.gongpingjialoan.activity.main.BaseActivity;
import com.gongpingjialoan.activity.main.MainActivity;
import com.gongpingjialoan.bean.AssessmentData;
import com.gongpingjialoan.data.SellPrivateCarBean;

/**
 * Created by Administrator on 2016/8/16.
 */
public class SellPrivateSuccessActivity extends BaseActivity {

    private Button mButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        isSendData = true ;
        action = "sell_pubCarSource_success";
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sell_private_success);
        setRightTitle("卖车记录");
        findViewById(R.id.right_title).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                StepMonitor.getInstance().addMonitor(new Monitor("click", "my_sellRecord", System.currentTimeMillis(), 1.0f));
                startActivity(new Intent(SellPrivateSuccessActivity.this, SellCarHistoryActivity.class));
            }
        });
        findViewById(R.id.title_back).setVisibility(View.GONE);
        setTitle("个人卖车");
        mButton = (Button) findViewById(R.id.button);
        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                gotoMain();
            }
        });

    }

    @Override
    public void initTitleBar() {
        View backV = findViewById(R.id.title_back);
        backV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                gotoMain();
            }
        });
    }



    private void gotoMain() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("type" , "buycar");
        startActivity(intent);
    }


    @Override
    public void onBackPressed() {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        AssessmentData.getInstance().clear();
        SellPrivateCarBean.getInstance().clear();
    }
}
